package ooday04;

public class anonymousInnerClasses {
    public static void main(String[] args) {

        aa aa = new aa();

        new boo2(){};
        int num=5;
        num=6;
        aoo1 flyfly = new aoo1() {
            @Override
            void fly() {
                System.out.println("flyfly");
                //  num=7; //匿名内部类不可以修改外部的值
            }
        };
        flyfly.fly();
        flyfly.fly();

    }
}

abstract class aoo1{
    abstract void fly();
}
abstract class boo2{}

class aa{

    String name;
    void eat(){
        bb bb1 = new bb();
        bb1.show();
    }


    class bb{
        void show(){
            System.out.println(aa.this.name);//内部类想访问外部类成员  外部类名.this.属性或方法
            aa.this.eat();
        }


    }

}
